#-*- coding:utf-8 -*-
from django.db import models

# Create your models here.
class Index(models.Model):
    class Meta:
        verbose_name = u'自动回复关键词'
        verbose_name_plural = verbose_name

    id = models.AutoField(primary_key=True)
    msg_key = models.CharField(max_length=20, verbose_name=u'关键词')

    def __unicode__(self):
        return self.msg_key
    


class News(models.Model):
    class Meta:
        verbose_name = u'图文回复'
        verbose_name_plural = verbose_name

    id = models.AutoField(primary_key=True)
    msg_key = models.ForeignKey(Index, related_name='news_key', verbose_name=u'关键词')
    title = models.CharField(max_length=100, verbose_name=u'标题')
    description = models.TextField(null=True, blank=True, verbose_name=u'简介')
    pic_url = models.ImageField(null=True, blank=True, verbose_name=u'图片', upload_to='./images/')
    content = models.TextField()

    def __unicode__(self):
        return self.title

class Text(models.Model):
    class Meta:
        verbose_name = u'文本回复'
        verbose_name_plural = verbose_name


    msg_key = models.CharField(max_length=20, verbose_name=u'关键词')
    content = models.TextField(null=True, blank=True, verbose_name=u'内容')

    def __unicode__(self):
        pass
    